package main

import (
	"os"
	"runtime/trace"
	"strings"
)

func Split(inputString, spe string) (result []string) {
	idx := strings.Index(inputString, spe)
	for idx > -1 {
		result = append(result, inputString[:idx])
		inputString = inputString[idx+len(spe):]
		idx = strings.Index(inputString, spe)
	}
	result = append(result, inputString[:])
	return
}
func main() {
	traceOut, _ := os.Create("./trace.pprof")
	trace.Start(traceOut) //开始trace
	defer trace.Stop()    //结束trace
	Split("a,b,c", ",")   //监控的对象
}
